package com.edata.bigdata.utils

import scala.util.matching.Regex

object CommonUtils {

  def findSubStrByRegex(str: String, regex: String): String = {
    val pattern = new Regex(regex)
    val matched = pattern.findFirstMatchIn(str)
    var result = ""
    matched.foreach { m =>
      result = m.group(1)
    }
    result
  }

}